<?php
//取出传来的id
include_once 'dbconfig.php';
if(!isset($_GET['id'])){
	header("location:index.php");
}
$id = $_GET['id'];

//查询数据
//要求准备语句的命名参数
$sql = "delete from teachhour where id=:id";
$pdoStatment = $pdo->prepare($sql);
$ret = $pdoStatment->execute(array('id'=>$id));
if($ret){
	header("location:jump.php?url=index.php&error=数据删除成功&wait=2");
}else{
	header("location:jump.php?url=index.php&error=数据删除失败&wait=2");
}
exit();
?>